#include "typedef.h"

#ifndef _KUAI_XYZ_H_
#define _KUAI_XYZ_H_

namespace kuai {

	struct XYZ {
		XYZ() 
		{ }
		XYZ(RealNumber x0, RealNumber y0, RealNumber z0)
			: x(x0), y(y0), z(z0)
		{ }
		RealNumber x, y, z;
		
		XYZ& operator+=(const XYZ& v1);
		XYZ& operator-=(const XYZ& v1);
		XYZ& operator*=(const XYZ& v1);
		XYZ& operator*=(const RealNumber& v1);
		XYZ& operator/=(const RealNumber& v1);
		
		RealNumber abs() const;
		XYZ operator-() const;
		
		XYZ operator+(const XYZ& v2) const;
		XYZ operator-(const XYZ& v2) const;
		XYZ operator*(const XYZ& v2) const;
		XYZ operator*(const RealNumber& v2) const;
		XYZ operator/(const RealNumber& v2) const;
		
		bool operator==(const XYZ& v2) const;
		bool operator!=(const XYZ& v2) const;
	};	
	
	RealNumber dot(const XYZ& v1, const XYZ& v2);
	
	RealNumber angle(const XYZ& v1, const XYZ& v2);
	RealNumber angle(const XYZ& v1, const XYZ& v2, const XYZ& v3);
	RealNumber torsion(const XYZ& v1, const XYZ& v2, const XYZ& v3, const XYZ& v4);
}

#endif
